# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-gnupg
pkgver=0.5.1
pkgrel=1
pkgdesc="Python3 wrapper for the Gnu Privacy Guard (GPG or GnuPG)"
url="https://gnupg.readthedocs.io/en/latest/"
arch="noarch"
license="BSD-3-Clause"
depends="python3 gnupg"
makedepends="py3-setuptools py3-wheel py3-gpep517 py3-installer"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://pypi.io/packages/source/p/python-gnupg/python-gnupg-$pkgver.tar.gz"
builddir="$srcdir/python-gnupg-$pkgver"
options="!check" # hang

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
7be68c2f8aad0e0923fd27e53bbbfaea8fe7b3816ff231ab6a06a52efd3a4a594af27355abcf0a453e1d0556ad8c02e960ff7c84cb0ce7d053a1adc91131eea0  python-gnupg-0.5.1.tar.gz
"
